{extend name='extra@admin/content'}

{block name="button"}

{/block}

{block name="content"}

<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="__SELF__" onsubmit="return false" method="get">
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">订货单号</label>
        <div class="layui-input-inline">
            <input name="sn" value="{$Think.get.sn|default=''}" placeholder="请输入订货单号" class="layui-input">
        </div>
    </div>


    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>
</form>
<!-- 表单搜索 结束 -->

<form onsubmit="return false;" data-auto="true" method="post">
    {if empty($list)}
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    {else}
    <input type="hidden" value="resort" name="action"/>
    <table class="layui-table" lay-skin="line" lay-size="sm">
        <thead>
            <tr>
                <th class='text-left nowrap'>订单号</th>
                <th class='text-left nowrap'>状态</th>
                <th class='text-left nowrap'>生成时间</th>
                <th class='text-left nowrap'>处理时间</th>
                <th class='text-left nowrap'>总部留言</th>
                <th class='text-left nowrap'>操作</th>
            </tr>
        </thead>
        <tbody>
            {volist name='list' id='vo'}
            <tr>
                <td class='text-left nowrap'>
                    {$vo.sn}
                </td>
                <td class='text-left nowrap'>
                    {if $vo.status==0}申请中{/if}
                    {if $vo.status==1}已发货{/if}
                    {if $vo.status==2}已驳回{/if}
                    {if $vo.status==3}已收货{/if}
                </td>
                <td class='text-left nowrap'>
                    {$vo.addtime|date='Y-m-d H:i:s',###}
                </td>
                <td class='text-left nowrap'>
                    {if $vo.deal_time}{$vo.deal_time|date='Y-m-d H:i:s',###}{/if}
                </td>
                <td class='text-left nowrap'>
                    {$vo.remark}
                </td>
                <td class='text-left nowrap'>
                    {if auth("$classuri/detail")}
                    <span class="text-explode">|</span>
                    <a data-modal='{:url("$classuri/detail")}?id={$vo.id}' data-title="订货单详情-{$vo.sn}" href="javascript:void(0)">订货单</a>
                    {/if}

                    {if auth("$classuri/rdetail")}
                    <span class="text-explode">|</span>
                    <a data-modal='{:url("$classuri/rdetail")}?id={$vo.id}' data-title="收货单详情-{$vo.sn}" href="javascript:void(0)">收货单</a>
                    {/if}

                    {if auth("$classuri/receive")}
                    {if $vo.status == 1}
                    <span class="text-explode">|</span>
                    <a data-modal='{:url("$classuri/receive")}?id={$vo.id}' data-title="确认收货-{$vo.sn}" href="javascript:void(0)">确认收货</a>
                    {/if}
                    {/if}
                </td>
            </tr>
            {/volist}
        </tbody>
    </table>
    {if isset($page)}<p>{$page}</p>{/if}
    {/if}
    <script>
        window.laydate.render({range: true, elem: '#range-date', format: 'yyyy/MM/dd'});
    </script>
</form>
{/block}